***US***
use "/Users/eranamsalem/Desktop/Voting for Our National Story/joint_data_narratives - with codings - for SPSS (1).dta", clear
use "C:\Users\odelia\Downloads\joint_data_narratives - with codings - for SPSS.dta" 
keep if countryID==4
*Three-level voting variable ("don't know" = 99)
tab US_votechoice, sort
gen us_vote = 1 if US_votechoice==2
replace us_vote = 2 if US_votechoice==1 | US_votechoice==3 
replace us_vote = 3 if US_votechoice==4 | US_votechoice==5 | US_votechoice==99
label define us_vote1 1 "Populist" 2 "Other Candidate" 3 "Other Answer"
label values us_vote us_vote1
tab us_vote
* Two-level voting variable
gen populist_vote_us = .
replace populist_vote_us = 1 if US_votechoice==2
replace populist_vote_us = 0 if US_votechoice!=2
tab populist_vote_us

* Frequency tables for general and specific stories
tab pastEvent_groups, sort
tab general_past, sort
tab futureEvent_groups, sort
tab general_future, sort
tab actor_groups, sort
tab general_actor, sort



label define general_past 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 "Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
17 "P.assas" 18 "Sport" , replace
label values general_past general_past

label define general_future 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 " Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
18 "Sport" , replace
label values general_future general_future

label define US_votechoice 1 "Clinton" 2 "Trump" , replace
label values US_votechoice US_votechoice

mca general_past general_future US_votechoice if US_votechoice<3 &  general_past<20 & general_future<20   , dim(2) 
mcaplot, overlay xline(0) yline(0)  mlabpos(12) mlabgap(2) scale(.8) ///
mlabsize(vsmall)


* Models
* Recode some of the independent variables
tab political_discussion
replace political_discussion = . if political_discussion==99
revrs political_discussion
tab revpolitical_discussion
tab political_interest
replace political_interest=. if political_interest==99
tab political_interest
tab leftright
replace leftright = . if leftright==99
tab leftright
alpha newspaper_consumption newsweb_consumption tvnews_consumption
gen general_news_consumption = (newspaper_consumption + newsweb_consumption + tvnews_consumption)/3
tab general_news_consumption
gen rural = US_residence
replace rural = 1 if US_residence==7
replace rural = 0 if US_residence!=7
tab rural
tab US_education 
replace US_education = . if US_education==99
tab US_education 
tab US_income 
replace US_income = . if US_income==88
replace US_income = . if US_income==99
tab US_income 
tab US_social_class 
recode US_social_class (6=0)
replace US_social_class = . if US_social_class==88
replace US_social_class = . if US_social_class==99
tab US_social_class
revrs US_social_class
tab revUS_social_class
tab statement8
replace statement8 = . if statement8==99
tab statement8
gen know1 = 1 if US_polknowledge1==1
replace know1 = 0 if know1==.
gen know2 = 1 if US_polknowledge2==1
replace know2 = 0 if know2==.
gen political_knowledge = know1+know2


* Logistic regression predicting populist vote
* Most basic model
logit populist_vote_us past_general_distant1 future_general_distant1 actor_specific_distant1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eran.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
* Other possible models
logit populist_vote_us past_general_distant1_nomis future_general_distant1_nomis actor_specific_distant1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eran.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us past_general_distant3 future_general_distant3 actor_specific_distant1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eran.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us past_general_distant3_nomis future_general_distant3_nomis actor_specific_distant1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eran.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)



*The basic narrative variable - number of stories
gen total_past = 1
replace total_past = 0 if pastEvent_groups == "NA"
gen total_future = 1
replace total_future = 0 if futureEvent_groups == "NA"
gen total_actor = 1
replace total_actor = 0 if actor_groups == "NA"
gen National_Narrative = total_past + total_future + total_actor



* Coded stories						
gen	traditional_past	=	.				
replace	traditional_past	=	0	if	pastEvent_groups	==	"NA"
replace	traditional_past	=	0	if	pastEvent_groups	==	"September 11 attacks"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Freedom, rights, equality"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Civil war"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Independence"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Revolutionary War"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Writing of constitution and amendments"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Slavery"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW2"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Many"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Obama era"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Founding fathers"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Health care programs"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Immigration"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Kennedy assassination"
replace	traditional_past	=	0	if	pastEvent_groups	==	"More jobs"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Reagan era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"2003 invasion of Iraq"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Atomic bomb on Japan"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Discovering America"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Elections (2016, 1980 etc.)"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Terrorism"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Vietnam War"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Wars and military conflicts"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Better social welfare"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Cold war"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Economy problems"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Foreign policy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Martin Luther King era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Police brutality"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Fall of communism"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Great Depression"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Moon landing"
replace	traditional_past	=	0	if	pastEvent_groups	==	"New Deal"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Political lies and corruption"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Roosevelt era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"USA Lands"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW1"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Attacks on America"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Foundation of 2 political parties"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Kennedy era"
replace	traditional_past	=	1	if	pastEvent_groups	==	"More religion in country"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Reagan attempted assassination"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Revolutionary war"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Tea party"
replace	traditional_past	=	0	if	pastEvent_groups	==	"1950-1955"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Battle of 1814"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Before 2010"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Citizens turned against each other"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Civil service act"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Clinton era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Congress' inability to compromise"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Democracy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Diversity"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Dying of Prince"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Elimination of the gold standard"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Genocide of Indians \ taking their lands"
replace	traditional_past	=	0	if	pastEvent_groups	==	"George Bush era"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Golden era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Good leaders"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Hillary Clinton era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Hurricane Katrina"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Killing Bin Laden"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Korean war"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Labor day"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Legacy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Legalizing marijuana"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Lincoln assassination"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Martin Luther King assassination"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Military conflicts"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Nixon era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Our world and society today"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Presidential debates"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Release of prisoners"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Safety of USA"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Supreme court decisions"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Technological and scientific developments"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The people"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW1, WW2"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War of 1812"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War stopped"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Watergate"
							
							
gen	survival_past	=	.				
replace	survival_past	=	0	if	pastEvent_groups	==	"NA"
replace	survival_past	=	1	if	pastEvent_groups	==	"September 11 attacks"
replace	survival_past	=	0	if	pastEvent_groups	==	"Freedom, rights, equality"
replace	survival_past	=	1	if	pastEvent_groups	==	"Civil war"
replace	survival_past	=	0	if	pastEvent_groups	==	"Independence"
replace	survival_past	=	1	if	pastEvent_groups	==	"Revolutionary War"
replace	survival_past	=	0	if	pastEvent_groups	==	"Writing of constitution and amendments"
replace	survival_past	=	0	if	pastEvent_groups	==	"Slavery"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW2"
replace	survival_past	=	0	if	pastEvent_groups	==	"Many"
replace	survival_past	=	0	if	pastEvent_groups	==	"Obama era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Founding fathers"
replace	survival_past	=	0	if	pastEvent_groups	==	"Health care programs"
replace	survival_past	=	0	if	pastEvent_groups	==	"Immigration"
replace	survival_past	=	0	if	pastEvent_groups	==	"Kennedy assassination"
replace	survival_past	=	1	if	pastEvent_groups	==	"More jobs"
replace	survival_past	=	0	if	pastEvent_groups	==	"Reagan era"
replace	survival_past	=	1	if	pastEvent_groups	==	"2003 invasion of Iraq"
replace	survival_past	=	1	if	pastEvent_groups	==	"Atomic bomb on Japan"
replace	survival_past	=	0	if	pastEvent_groups	==	"Discovering America"
replace	survival_past	=	0	if	pastEvent_groups	==	"Elections (2016, 1980 etc.)"
replace	survival_past	=	1	if	pastEvent_groups	==	"Terrorism"
replace	survival_past	=	1	if	pastEvent_groups	==	"Vietnam War"
replace	survival_past	=	1	if	pastEvent_groups	==	"Wars and military conflicts"
replace	survival_past	=	1	if	pastEvent_groups	==	"Better social welfare"
replace	survival_past	=	1	if	pastEvent_groups	==	"Cold war"
replace	survival_past	=	1	if	pastEvent_groups	==	"Economy problems"
replace	survival_past	=	0	if	pastEvent_groups	==	"Foreign policy"
replace	survival_past	=	0	if	pastEvent_groups	==	"Martin Luther King era"
replace	survival_past	=	1	if	pastEvent_groups	==	"Police brutality"
replace	survival_past	=	0	if	pastEvent_groups	==	"Fall of communism"
replace	survival_past	=	0	if	pastEvent_groups	==	"Great Depression"
replace	survival_past	=	0	if	pastEvent_groups	==	"Moon landing"
replace	survival_past	=	0	if	pastEvent_groups	==	"New Deal"
replace	survival_past	=	0	if	pastEvent_groups	==	"Political lies and corruption"
replace	survival_past	=	0	if	pastEvent_groups	==	"Roosevelt era"
replace	survival_past	=	0	if	pastEvent_groups	==	"USA Lands"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW1"
replace	survival_past	=	1	if	pastEvent_groups	==	"Attacks on America"
replace	survival_past	=	0	if	pastEvent_groups	==	"Foundation of 2 political parties"
replace	survival_past	=	0	if	pastEvent_groups	==	"Kennedy era"
replace	survival_past	=	0	if	pastEvent_groups	==	"More religion in country"
replace	survival_past	=	0	if	pastEvent_groups	==	"Reagan attempted assassination"
replace	survival_past	=	1	if	pastEvent_groups	==	"Revolutionary war"
replace	survival_past	=	0	if	pastEvent_groups	==	"Tea party"
replace	survival_past	=	0	if	pastEvent_groups	==	"1950-1955"
replace	survival_past	=	1	if	pastEvent_groups	==	"Battle of 1814"
replace	survival_past	=	0	if	pastEvent_groups	==	"Before 2010"
replace	survival_past	=	1	if	pastEvent_groups	==	"Citizens turned against each other"
replace	survival_past	=	0	if	pastEvent_groups	==	"Civil service act"
replace	survival_past	=	0	if	pastEvent_groups	==	"Clinton era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Congress' inability to compromise"
replace	survival_past	=	0	if	pastEvent_groups	==	"Democracy"
replace	survival_past	=	0	if	pastEvent_groups	==	"Diversity"
replace	survival_past	=	0	if	pastEvent_groups	==	"Dying of Prince"
replace	survival_past	=	0	if	pastEvent_groups	==	"Elimination of the gold standard"
replace	survival_past	=	0	if	pastEvent_groups	==	"Genocide of Indians \ taking their lands"
replace	survival_past	=	0	if	pastEvent_groups	==	"George Bush era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Golden era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Good leaders"
replace	survival_past	=	0	if	pastEvent_groups	==	"Hillary Clinton era"
replace	survival_past	=	1	if	pastEvent_groups	==	"Hurricane Katrina"
replace	survival_past	=	1	if	pastEvent_groups	==	"Industrial revolution"
replace	survival_past	=	1	if	pastEvent_groups	==	"Killing Bin Laden"
replace	survival_past	=	1	if	pastEvent_groups	==	"Korean war"
replace	survival_past	=	0	if	pastEvent_groups	==	"Labor day"
replace	survival_past	=	0	if	pastEvent_groups	==	"Legacy"
replace	survival_past	=	0	if	pastEvent_groups	==	"Legalizing marijuana"
replace	survival_past	=	0	if	pastEvent_groups	==	"Lincoln assassination"
replace	survival_past	=	0	if	pastEvent_groups	==	"Martin Luther King assassination"
replace	survival_past	=	1	if	pastEvent_groups	==	"Military conflicts"
replace	survival_past	=	0	if	pastEvent_groups	==	"Nixon era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Our world and society today"
replace	survival_past	=	0	if	pastEvent_groups	==	"Presidential debates"
replace	survival_past	=	0	if	pastEvent_groups	==	"Release of prisoners"
replace	survival_past	=	1	if	pastEvent_groups	==	"Safety of USA"
replace	survival_past	=	0	if	pastEvent_groups	==	"Supreme court decisions"
replace	survival_past	=	0	if	pastEvent_groups	==	"Technological and scientific developments"
replace	survival_past	=	0	if	pastEvent_groups	==	"The people"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW1, WW2"
replace	survival_past	=	1	if	pastEvent_groups	==	"War of 1812"
replace	survival_past	=	1	if	pastEvent_groups	==	"War stopped"
replace	survival_past	=	1	if	pastEvent_groups	==	"Watergate"
							
							
gen	self_expression_past	=	.				
replace	self_expression_past	=	0	if	pastEvent_groups	==	"NA"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"September 11 attacks"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Freedom, rights, equality"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Civil war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Independence"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Revolutionary War"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Writing of constitution and amendments"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Slavery"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW2"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Many"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Obama era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Founding fathers"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Health care programs"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Immigration"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Kennedy assassination"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"More jobs"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Reagan era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"2003 invasion of Iraq"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Atomic bomb on Japan"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Discovering America"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Elections (2016, 1980 etc.)"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Terrorism"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Vietnam War"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Wars and military conflicts"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Better social welfare"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Cold war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Economy problems"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Foreign policy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Martin Luther King era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Police brutality"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Fall of communism"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Great Depression"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Moon landing"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"New Deal"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Political lies and corruption"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Roosevelt era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"USA Lands"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW1"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Attacks on America"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Foundation of 2 political parties"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Kennedy era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"More religion in country"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Reagan attempted assassination"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Revolutionary war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Tea party"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"1950-1955"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Battle of 1814"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Before 2010"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Citizens turned against each other"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Civil service act"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Clinton era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Congress' inability to compromise"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Democracy"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Diversity"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Dying of Prince"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Elimination of the gold standard"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Genocide of Indians \ taking their lands"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"George Bush era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Golden era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Good leaders"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Hillary Clinton era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Hurricane Katrina"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Killing Bin Laden"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Korean war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Labor day"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Legacy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Legalizing marijuana"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Lincoln assassination"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Martin Luther King assassination"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Military conflicts"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Nixon era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Our world and society today"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Presidential debates"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Release of prisoners"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Safety of USA"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Supreme court decisions"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Technological and scientific developments"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The people"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW1, WW2"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War of 1812"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War stopped"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Watergate"
							
							
gen	us_vs_them_past	=	.				
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"NA"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"September 11 attacks"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Freedom, rights, equality"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Civil war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Independence"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Revolutionary War"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Writing of constitution and amendments"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Slavery"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW2"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Obama era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Founding fathers"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Health care programs"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Immigration"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Kennedy assassination"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"More jobs"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Reagan era"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"2003 invasion of Iraq"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Atomic bomb on Japan"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Discovering America"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Elections (2016, 1980 etc.)"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Terrorism"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Vietnam War"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Wars and military conflicts"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Better social welfare"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Cold war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Economy problems"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Foreign policy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Martin Luther King era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Police brutality"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Fall of communism"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Great Depression"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Moon landing"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"New Deal"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Political lies and corruption"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Roosevelt era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"USA Lands"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW1"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Attacks on America"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Foundation of 2 political parties"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Kennedy era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"More religion in country"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Reagan attempted assassination"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Revolutionary war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Tea party"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"1950-1955"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Battle of 1814"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Before 2010"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Citizens turned against each other"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Civil service act"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Clinton era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Congress' inability to compromise"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Democracy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Diversity"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Dying of Prince"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Elimination of the gold standard"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Genocide of Indians \ taking their lands"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"George Bush era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Golden era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Good leaders"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Hillary Clinton era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Hurricane Katrina"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Killing Bin Laden"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Korean war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Labor day"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Legacy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Legalizing marijuana"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Lincoln assassination"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Martin Luther King assassination"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Military conflicts"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Nixon era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Our world and society today"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Presidential debates"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Release of prisoners"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Safety of USA"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Supreme court decisions"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Technological and scientific developments"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The people"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW1, WW2"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"War of 1812"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"War stopped"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Watergate"
							
							
gen	us_and_them_past	=	.				
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"NA"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"September 11 attacks"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Freedom, rights, equality"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Civil war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Independence"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Revolutionary War"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Writing of constitution and amendments"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Slavery"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW2"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Obama era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Founding fathers"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Health care programs"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Immigration"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Kennedy assassination"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"More jobs"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Reagan era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"2003 invasion of Iraq"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Atomic bomb on Japan"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Discovering America"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Elections (2016, 1980 etc.)"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Terrorism"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Vietnam War"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Wars and military conflicts"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Better social welfare"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Cold war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Economy problems"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Foreign policy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Martin Luther King era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Police brutality"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Fall of communism"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Great Depression"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Moon landing"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"New Deal"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Political lies and corruption"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Roosevelt era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"USA Lands"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW1"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Attacks on America"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Foundation of 2 political parties"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Kennedy era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"More religion in country"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Reagan attempted assassination"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Revolutionary war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Tea party"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"1950-1955"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Battle of 1814"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Before 2010"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Citizens turned against each other"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Civil service act"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Clinton era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Congress' inability to compromise"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Democracy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Diversity"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Dying of Prince"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Elimination of the gold standard"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Genocide of Indians \ taking their lands"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"George Bush era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Golden era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Good leaders"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Hillary Clinton era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Hurricane Katrina"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Killing Bin Laden"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Korean war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Labor day"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Legacy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Legalizing marijuana"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Lincoln assassination"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Martin Luther King assassination"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Military conflicts"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Nixon era"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Our world and society today"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Presidential debates"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Release of prisoners"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Safety of USA"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Supreme court decisions"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Technological and scientific developments"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The people"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW1, WW2"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War of 1812"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War stopped"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Watergate"



							
gen	traditional_future	=	.				
replace	traditional_future	=	0	if	futureEvent_groups	==	"NA"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better economy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Freedom, rights, equality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Peace"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Election results"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Social harmony"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More jobs"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better politicians, replace politicians"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Healthcare policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"End of terror"
replace	traditional_future	=	0	if	futureEvent_groups	==	"End of racism"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Worse future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Country's status in world"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Technological and scientific developments"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less political polarization"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better environment"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Gun control"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Life quality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Social welfare"
replace	traditional_future	=	0	if	futureEvent_groups	==	"War"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Change political system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Drugs policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Limit terms of politicians"
replace	traditional_future	=	1	if	futureEvent_groups	==	"More religion in our lives"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Back to constitution"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less corruption"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More parties in politics"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better security"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More regulations on politics"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better education"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Energy policy"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Return to traditional values"
replace	traditional_future	=	0	if	futureEvent_groups	==	"No violence"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Change"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Change supreme court character"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Many"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Worse economy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Better world"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Cure for diseases"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less police brutality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More relations with other countries"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More stability"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Presidential debate results"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Revolution"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Gold rush"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Hillary Clinton in jail"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Hosting olympic games"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Hunger"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Liberal media crash"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More globalization"
replace	traditional_future	=	0	if	futureEvent_groups	==	"More internal focus by government"
replace	traditional_future	=	0	if	futureEvent_groups	==	"National identity"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Veterans care"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Work ethic"
							
							
gen	survival_future	=	.				
replace	survival_future	=	0	if	futureEvent_groups	==	"NA"
replace	survival_future	=	1	if	futureEvent_groups	==	"Better economy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Freedom, rights, equality"
replace	survival_future	=	0	if	futureEvent_groups	==	"Peace"
replace	survival_future	=	0	if	futureEvent_groups	==	"Election results"
replace	survival_future	=	0	if	futureEvent_groups	==	"Social harmony"
replace	survival_future	=	1	if	futureEvent_groups	==	"More jobs"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better politicians, replace politicians"
replace	survival_future	=	0	if	futureEvent_groups	==	"Healthcare policy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	survival_future	=	1	if	futureEvent_groups	==	"End of terror"
replace	survival_future	=	0	if	futureEvent_groups	==	"End of racism"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better future"
replace	survival_future	=	0	if	futureEvent_groups	==	"Worse future"
replace	survival_future	=	0	if	futureEvent_groups	==	"Country's status in world"
replace	survival_future	=	0	if	futureEvent_groups	==	"Technological and scientific developments"
replace	survival_future	=	0	if	futureEvent_groups	==	"Less political polarization"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better environment"
replace	survival_future	=	1	if	futureEvent_groups	==	"Gun control"
replace	survival_future	=	0	if	futureEvent_groups	==	"Life quality"
replace	survival_future	=	1	if	futureEvent_groups	==	"Social welfare"
replace	survival_future	=	1	if	futureEvent_groups	==	"War"
replace	survival_future	=	0	if	futureEvent_groups	==	"Change political system"
replace	survival_future	=	1	if	futureEvent_groups	==	"End poverty"
replace	survival_future	=	0	if	futureEvent_groups	==	"Drugs policy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Limit terms of politicians"
replace	survival_future	=	0	if	futureEvent_groups	==	"More religion in our lives"
replace	survival_future	=	0	if	futureEvent_groups	==	"Back to constitution"
replace	survival_future	=	0	if	futureEvent_groups	==	"Less corruption"
replace	survival_future	=	0	if	futureEvent_groups	==	"More parties in politics"
replace	survival_future	=	1	if	futureEvent_groups	==	"Better security"
replace	survival_future	=	0	if	futureEvent_groups	==	"More regulations on politics"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better education"
replace	survival_future	=	0	if	futureEvent_groups	==	"Energy policy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	survival_future	=	1	if	futureEvent_groups	==	"No violence"
replace	survival_future	=	0	if	futureEvent_groups	==	"Change"
replace	survival_future	=	0	if	futureEvent_groups	==	"Change supreme court character"
replace	survival_future	=	0	if	futureEvent_groups	==	"Many"
replace	survival_future	=	1	if	futureEvent_groups	==	"Worse economy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Better world"
replace	survival_future	=	1	if	futureEvent_groups	==	"Cure for diseases"
replace	survival_future	=	1	if	futureEvent_groups	==	"Less police brutality"
replace	survival_future	=	0	if	futureEvent_groups	==	"More relations with other countries"
replace	survival_future	=	0	if	futureEvent_groups	==	"More stability"
replace	survival_future	=	0	if	futureEvent_groups	==	"Presidential debate results"
replace	survival_future	=	0	if	futureEvent_groups	==	"Revolution"
replace	survival_future	=	0	if	futureEvent_groups	==	"Gold rush"
replace	survival_future	=	0	if	futureEvent_groups	==	"Hillary Clinton in jail"
replace	survival_future	=	0	if	futureEvent_groups	==	"Hosting olympic games"
replace	survival_future	=	1	if	futureEvent_groups	==	"Hunger"
replace	survival_future	=	0	if	futureEvent_groups	==	"Liberal media crash"
replace	survival_future	=	0	if	futureEvent_groups	==	"More globalization"
replace	survival_future	=	0	if	futureEvent_groups	==	"More internal focus by government"
replace	survival_future	=	0	if	futureEvent_groups	==	"National identity"
replace	survival_future	=	0	if	futureEvent_groups	==	"Veterans care"
replace	survival_future	=	0	if	futureEvent_groups	==	"Work ethic"
							
							
gen	self_expression_future	=	.				
replace	self_expression_future	=	0	if	futureEvent_groups	==	"NA"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better economy"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Freedom, rights, equality"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Peace"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Election results"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Social harmony"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More jobs"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better politicians, replace politicians"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Healthcare policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"End of terror"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"End of racism"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Worse future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Country's status in world"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Technological and scientific developments"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less political polarization"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Better environment"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Gun control"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Life quality"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Social welfare"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"War"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Change political system"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Drugs policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Limit terms of politicians"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More religion in our lives"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Back to constitution"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less corruption"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More parties in politics"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better security"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More regulations on politics"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Better education"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Energy policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"No violence"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Change"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Change supreme court character"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Many"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Worse economy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Better world"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Cure for diseases"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less police brutality"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More relations with other countries"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More stability"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Presidential debate results"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Revolution"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Gold rush"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Hillary Clinton in jail"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Hosting olympic games"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Hunger"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Liberal media crash"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More globalization"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"More internal focus by government"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"National identity"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Veterans care"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Work ethic"
							
							
gen	us_vs_them_future	=	.				
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"NA"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better economy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Freedom, rights, equality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Peace"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Election results"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Social harmony"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More jobs"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better politicians, replace politicians"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Healthcare policy"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Immigration policy"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"End of terror"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"End of racism"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better future"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Worse future"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Country's status in world"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific developments"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less political polarization"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better environment"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Gun control"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Life quality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Social welfare"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"War"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Change political system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Drugs policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Limit terms of politicians"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More religion in our lives"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Back to constitution"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less corruption"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More parties in politics"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better security"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More regulations on politics"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better education"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Energy policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"No violence"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Change"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Change supreme court character"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Many"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Worse economy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Better world"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Cure for diseases"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less police brutality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More relations with other countries"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More stability"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Presidential debate results"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Revolution"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Gold rush"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Hillary Clinton in jail"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Hosting olympic games"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Hunger"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Liberal media crash"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More globalization"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"More internal focus by government"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"National identity"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Veterans care"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Work ethic"
							
							
gen	us_and_them_future	=	.				
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"NA"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better economy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Freedom, rights, equality"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Peace"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Election results"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Social harmony"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More jobs"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better politicians, replace politicians"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Healthcare policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End of terror"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End of racism"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better future"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Worse future"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Country's status in world"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific developments"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less political polarization"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better environment"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Gun control"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Life quality"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Social welfare"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"War"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Change political system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Drugs policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Limit terms of politicians"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More religion in our lives"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Back to constitution"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less corruption"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More parties in politics"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better security"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More regulations on politics"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Better education"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Energy policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"No violence"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Change"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Change supreme court character"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Many"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Worse economy"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Better world"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Cure for diseases"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less police brutality"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"More relations with other countries"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More stability"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Presidential debate results"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Revolution"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Gold rush"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Hillary Clinton in jail"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Hosting olympic games"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Hunger"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Liberal media crash"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"More globalization"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"More internal focus by government"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"National identity"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Veterans care"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Work ethic"



encode pastEvent_groups, generate(pastEvent_groups1)
encode futureEvent_groups, generate(futureEvent_groups1)

gen Storycalsification=.
replace Storycalsification=1 if survival_past==1 | survival_future==1
replace Storycalsification=2 if self_expression_past==1|self_expression_future==1
replace Storycalsification=3 if us_vs_them_past==1|us_vs_them_future==1

label define Storycalsification 1 "survival" 2 "Self-Expression" 3 "us/them", replace 
label values Storycalsification Storycalsification

mca   general_past general_future Storycalsification US_votechoice if US_votechoice<3 &  general_past<20 & general_future<20   , dim(2) 
mcaplot, overlay xline(0) yline(0)  mlabpos(12) mlabgap(2) scale(.8) ///
mlabsize(vsmall)
graph save  "C:\Users\odelia\Downloads\mca us.gph", replace

* Tabulations of new variables
tab1 traditional_past survival_past self_expression_past us_vs_them_past us_and_them_past traditional_future survival_future self_expression_future us_vs_them_future us_and_them_future National_Narrative
sum traditional_past survival_past self_expression_past us_vs_them_past us_and_them_past traditional_future survival_future self_expression_future us_vs_them_future us_and_them_future  National_Narrative
* Correlations between new variables and populist vote
pwcorr populist_vote_us traditional_past survival_past self_expression_past us_vs_them_past us_and_them_past traditional_future survival_future self_expression_future us_vs_them_future us_and_them_future  National_Narrative, sig


*Full model
logit populist_vote_us National_Narrative traditional_past survival_past self_expression_past us_vs_them_past us_and_them_past traditional_future survival_future self_expression_future us_vs_them_future us_and_them_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
*Full model with combined past and future variables
gen traditional1=traditional_past+traditional_future
gen survival1=survival_past+survival_future
gen self_expression1=self_expression_past+self_expression_future
gen us_vs_them1=us_vs_them_past+us_vs_them_future
gen us_and_them1=us_and_them_past+us_and_them_future
logit populist_vote_us  National_Narrative traditional1 survival1 self_expression1 us_vs_them1 us_and_them1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)


*Correlation of populist vote & "anti-system" for those who voted only
corr populist_vote_us National_Narrative
corr populist_vote_us National_Narrative if US_lastElectionChoice!=88




* "Baseline" model
logit populist_vote_us gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
* Test only "anti-systen" variable
logit populist_vote_us National_Narrative gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
* Test each variable separately
logit populist_vote_us traditional_past gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us survival_past gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us self_expression_past gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us us_vs_them_past gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us us_and_them_past gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us traditional_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us survival_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us self_expression_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us us_vs_them_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us us_and_them_future gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
* Test each combined variable separately
logit populist_vote_us traditional1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us survival1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us self_expression1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us us_vs_them1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)
logit populist_vote_us us_and_them1 gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)

* Survival-self-expression scale
gen survival_self_scale=.
replace survival_self_scale=-2 if survival1==2 & self_expression1==0
replace survival_self_scale=-1 if survival1==1 & self_expression1==0
replace survival_self_scale=-1 if survival1==2 & self_expression1==1
replace survival_self_scale=1 if self_expression1==1 & survival1==0
replace survival_self_scale=1 if self_expression1==2 & survival1==1
replace survival_self_scale=2 if self_expression1==2 & survival1==0
replace survival_self_scale=0 if survival1==self_expression1
* br survival1 self_expression1 survival_self_scale
tab survival_self_scale
* Model
logit populist_vote_us survival_self_scale gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)

* Us and them scale
gen us_them_scale=.
replace us_them_scale=-2 if us_vs_them1==2 & us_and_them1==0
replace us_them_scale=-1 if us_vs_them1==1 & us_and_them1==0
replace us_them_scale=-1 if us_vs_them1==2 & us_and_them1==1
replace us_them_scale=1 if us_and_them1==1 & us_vs_them1==0
replace us_them_scale=1 if us_and_them1==2 & us_vs_them1==1
replace us_them_scale=2 if us_and_them1==2 & us_vs_them1==0
replace us_them_scale=0 if  us_vs_them1==us_and_them1
tab us_them_scale
gen usvsthem=us_them_scale*-1

* Model
logit populist_vote_us us_them_scale gender statement8 political_knowledge political_interest revpolitical_discussion general_news_consumption leftright rural US_education US_income revUS_social_class US_qage i.US_religion
outreg2 using eranams.doc, alpha(0.001, 0.01, 0.05, 0.1) symbol(***, **, *, †) replace dec(2)





* Factor analysis of populist perceptions battery
recode statement1 (99=.)
recode statement2 (99=.)
recode statement3 (99=.)
recode statement4 (99=.)
recode statement5 (99=.)
recode statement6 (99=.)
recode statement7 (99=.)
recode statement8 (99=.)

tab1 statement1-statement8
factor statement1-statement8
revrs statement5-statement8
factor statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
alpha statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
gen populist_attitudes=(statement1+statement2+statement3+statement4+revstatement5+revstatement6+revstatement7+revstatement8)/8
tab populist_attitudes
ttest populist_attitudes, by(populist_vote_us)


* Models with control for populist attitudes and after removal of unnecessary covariates
logit populist_vote_us survival_self_scale populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us us_them_scale populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us National_Narrative populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us ultra_sens_past populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us ultra_sens_future populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us ultra_sens_actor populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion

* Combined models
logit populist_vote_us survival_self_scale us_them_scale populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
logit populist_vote_us ultra_sens_past ultra_sens_future ultra_sens_actor populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion

* Correlation of two scales
corr survival_self_scale us_them_scale

* Models for paper
logit populist_vote_us survival_self_scale us_them_scale populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
est sto t1
logit populist_vote_us ultra_sens_past ultra_sens_future ultra_sens_actor populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
est sto t2
coefplot (t1\t2), keep(*:survival_self_scale us_them_scale ultra_sens_past ultra_sens_future ultra_sens_actor) xline(0) nolabel

egen z_survival = std(survival_self_scale)
label variable z_survival "Survival-Self Expression"
egen z_us_them = std(us_them_scale)
label variable z_us_them "Us and Them"
egen z_past = std(ultra_sens_past)
label variable z_past "Proximity - Past"
egen z_future = std(ultra_sens_future)
label variable z_future "Proximity - Future"
egen z_actor = std(ultra_sens_actor)
label variable z_actor "Proximity - Actor"

set scheme plotplain


estimates clear
logit populist_vote_us z_survival z_us_them populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
est sto t1
logit populist_vote_us z_past z_future z_actor populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion
est sto t2
coefplot (t1\t2), keep(*:z_survival z_us_them z_past z_future z_actor) xline(0) title("US") 





* Models with log-transformed proximity variables
* gen log_past = ln(ultra_sens_past)
* gen log_future = ln(ultra_sens_future)
* gen log_actor = ln(ultra_sens_actor)
* logit populist_vote_us log_past log_future log_actor populist_attitudes gender  political_knowledge political_interest leftright  rural US_education US_income revUS_social_class US_qage i.US_religion


set scheme plottig
/*labeling of variables for reg coef.*/
label var us_vs_them1 "Us/them"
label var survival1 "Survival"
label var self_expression1 "Self-expression"
label var populist_attitudes "Populist attitudes"
label var gender "Female"
label var political_knowledge "Political knowledge"
label var political_interest "Political interest"
label var leftright "L-R ideology"
label var rural "Rural"
label var US_education "Education"
label var US_income "Income"
label var revUS_social_class "Class"
label var US_qage  "Age"
label var survival_past "Survival - past"
label var us_vs_them_future "Confrontational - future"
label var us_vs_them_past "Confrontational - past"
label var survival_future "Survival - future"
label var self_expression_future "Expressional - future"
label var self_expression_past "Expressional - past"


******************


/*logit*/
logit populist_vote_us us_vs_them1 survival1 ///
	self_expression1  populist_attitudes  gender  political_interest political_knowledge ///
	leftright  rural US_education revUS_social_class US_qage 
est sto m1	
coefplot (m1) , drop(_cons) xline(0) title("US")  ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 
graph save "us coef", replace

/*margins*/
margin, atmeans at(us_vs_them1= (-2 -1 0 1 2)) /*moving from not having past and future boundary story to having both past and future boundary increases the probabilty to vote rr by 19 percent.*/

/*robustness - without populist attitudes*/
logit populist_vote_us us_vs_them1 survival1 ///
	self_expression1   gender  political_interest political_knowledge ///
	leftright  rural US_education revUS_social_class US_qage 
est sto m1	
coefplot (m1) , drop(_cons) xline(0) title("US")  ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 
graph save "us coef without populist", replace





interflex populist_vote_us us_vs_them1 revUS_social_class  ,  type(kernel)  ///
dlabel("Us/them") xlabel("Social class") title("US") 
graph save "class_us", replace

logit populist_vote_us c.us_vs_them1##c.revUS_social_class US_education US_residence  gender political_interest 	leftright     US_qage survival1 self_expression1 populist_attitudes

est sto class_us	


interflex populist_vote_us us_vs_them1 US_residence revUS_social_class US_education ,  type(kernel)  ///
dlabel("Us/them") xlabel("Rural/Urban divide") title("US")  
graph save "rural_us", replace

interflex populist_vote_us us_vs_them1 US_education gender political_interest  US_qage  ,  type(kernel)  ///
dlabel("Us/them") xlabel("Education") title("US") 
graph save "edu_us", replace


logit populist_vote_us c.us_vs_them1##c.US_residence survival1 ///
	self_expression1 US_education    ///
	  populist_attitudes  gender  political_interest ///
	leftright     US_qage
est sto rural_us	

/*diperssion of populist story components in society*/
statplot us_vs_them_future self_expression_past, over(party_family) 
catplot us_vs_them_future populist_vote_us , percent(populist_vote_us) stack asyvars title("US")
graph save "usthem_US"



grc1leg "usthem_US" "usthem_DK" "usthem_NL" "usthem_UK", col(2) ycommon  

/*only past us versus them*/
logit populist_vote_us us_vs_them_future us_vs_them_past revUS_social_class US_education rural  revUS_social_class survival1 ///
	self_expression1  populist_attitudes  gender  political_interest ///
	leftright     US_qage
est sto past2






